'use strict';
module.exports = app => {
  const { INTEGER, STRING, BOOLEAN } = app.Sequelize;

  const Menu = app.model.define('menu', {
    menu_name: {//
      type: STRING,
      allowNull: false,
      omment: '菜单名称',
    },
    menu_url: {
      type: STRING,
      allowNull: false,
      omment: 'URL',
    },
    menu_icon: {
      type: STRING,
      allowNull: false,
      omment: '图标',
    },
    menu_type: {
      type: INTEGER,
      allowNull: false,
      omment: '类型     1：菜单   2：按钮',
    },
    menu_sort: {
      type: INTEGER,
      allowNull: false,
      omment: '排序',
    },
    parentId: {
      type: INTEGER,
      allowNull: false,
      omment: '上级菜单id',
    },
    permission: {
      type: STRING,
      defaultValue: 1,
      omment: '授权(如：sys:user:create)',
    },
    createdUser: {
      type: STRING,
      defaultValue: 1,
      omment: '创建用户',
    },
    modifiedUser: {
      type: STRING,
      defaultValue: 1,
      omment: '修改用户',
    },
    status: {
      type: BOOLEAN,
      allowNull: false,
      defaultValue: 1,
      comment: '展示 1 正常，0 禁用',
    },

  });

  return Menu;
};
